package edu.hubu.shop9.query;

import java.util.Date;

import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.ss.usermodel.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

public class PurchasebillQuery {
//	beginDate: "2021-07-13", endDate: "2021-07-28", state: ""
	private Date beginDate;
	private Date endDate;
	private Integer status;
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT-8")
	public Date getBeginDate() {
		return beginDate;
	}
//	前台往后台传递时间
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT-8")
	public Date getEndDate() {
		return endDate;
	}
//	前台往后台传递时间
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	public void setEndDate(Date endDate) {
		Date tempDate = null;
//		如果后一个时间节点不为null
		if(endDate != null){
			tempDate = DateUtils.addDays(endDate, 2);
		}
		this.endDate = tempDate;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}



}
